package com.example.demo.service;

import java.util.List;

import javax.annotation.Resource;
import javax.transaction.Transactional;

import org.springframework.stereotype.Service;

import com.example.demo.entity.Student;
import com.example.demo.repository.StudentRepository;

@Service
public class StudentService {
	
	@Resource
	private StudentRepository studentRepository;

	@Transactional
	public Student add(Student stu) {
		return studentRepository.save(stu);
	}
	
	public List<Student> add(Iterable<Student> stus) {
		return studentRepository.save(stus);
	}
}
